<template>
  <el-sub-menu v-if="item.children && item.children.length > 0" :index="item.id+''">
    <template #title>
      <i :class="item.icon"></i>
      <span class="ff-menu2">{{ i18n(item.name) }}</span>
    </template>
    <menu-item
        v-for="item2 in item.children"
        :key="item2.id"
        :item="item2"
    ></menu-item>
  </el-sub-menu>
  <el-menu-item
      v-else
      class="ff-menu2"
      @click="itemClick(item)"
      :class="(ObjectUtils.isEmpty(item.path)&&ObjectUtils.isEmpty(item.externalUrl))?'menu_no_path':''"
      :index="item.path">
    <i :class="item.icon"></i>
    <template #title>{{ i18n(item.name) }}</template>
  </el-menu-item>
</template>

<script lang="ts" setup>
import {reactive} from 'vue'
import {SysMenu} from "@/base/ts/api/biz/SysMenuApi.ts";
import {ObjectUtils} from "@/base/ts/utils/ObjectUtils.ts";
import router from "@/base/router";
import {useRoute} from "vue-router";
import {i18n} from "@/base/ts/service/I18nService.ts";
//父级props传输的内容解析
const props = defineProps(['item']);
//定义到item变量中
const item = reactive(props.item);

//外链
const itemClick = (item: SysMenu) => {
}

</script>

<script lang="ts">
export default {
  name: 'menuItem',
}
</script>
<style scoped>
</style>